package org.mayanjun.code.easyweb.springmvc.config;

/**
 * Global default constants definitions
 *
 * @author mayanjun(1/29/16)
 */
public abstract class Global {

    /**
     * The default value of error page
     */
    public static final String DEFAULT_ERROR_PAGE = "error";

    /**
     * Attribute key to access result of error in error page
     */
    public static final String ERROR_PAGE_KEY = "error";

    /**
     * The default value of package name to be scanned
     */
    public static final String DEFAULT_SCAN_PACKAGE = "org.mayanjun";

    /**
     * The default value of xml file to be scanned
     */
    public static final String DEFAULT_SCAN_XML = "spring-beans-*.xml";

    /**
     * The default value of properties file to be scanned
     */
    public static final String DEFAULT_SCAN_PROPS = "spring-props-*.properties";

    /**
     * Bean name to reference {@link org.springframework.beans.factory.config.PropertiesFactoryBean} which contains web.properties
     */
    public static final String BEAN_NAME_ROOT_PROPS = "rootprops";

    /**
     * Bean name to reference {@link org.springframework.beans.factory.config.PropertiesFactoryBean} which contains all properties
     */
    public static final String BEAN_NAME_ALL_PROPS = "props";

    /**
     * Bean name to reference resources
     */
    public static final String BEAN_NAME_ALL_PROPS_RESOURCES = "allPropertiesResurces";

    /**
     * The default value of MVC properties file
     */
    public static final String MVC_CONFIG_LOCATION = "classpath:web.properties";

    /**
     * The suffix of velocity view
     */
    public static final String VELOCITY_VIEW_SUFFIX = ".vm";

    public static final String VELOCITY_VIEW_LOCATION = "/WEB-INF/views/velocity/";

    /**
     * Request attribute key as a flag for perception of device
     */
    public static final String REQUEST_ATTR_PERCEIVE_DEVICE_KEY = Global.class.getName() + ".REQUEST_ATTR_PERCEIVE_DEVICE_KEY";

    /**
     * Request attribute key to access HandlerMethod object
     */
    public static final String REQUEST_ATTR_HANDLER_METHOD = Global.class.getName() + ".REQUEST_ATTR_HANDLER_METHOD";

    /**
     * The default value of castor mapping location
     */
    public static final String DEFAULT_CASTOR_MAPPING_LOCATIONS = "classpath:castor-mapping.xml";


    public static final String SERVLET_APPLICATION_CONTEXT_NAME = "org.springframework.web.servlet.FrameworkServlet.CONTEXT.dispatcher";

    public static final int DEFAULT_SPRING_ASYNC_TIMEOUT = 20000;

}
